<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 参数展开/扩展
        // 默认参数
        function show(a, b, ...args) {
            console.log(...args)
            // 参数扩展：收集剩余的参数

        }
        show(1, 5, 10, 12, 12)
        let arr = [1, 2, 3]
        let arr2 = [4, 5, 6]
        let arr3 = [...arr, ...arr2]
        console.log(arr3)
        let arr4 = [...arr3]
        console.log(arr4.join(','))

        function add(...args) {
            fn(...args)
        }
        function fn(a, b, ...args) {
            let aa = Number([...args].join(''))
            console.log(a + b + aa)
        }
        add(1, 5, 6)
        /*****************************************默认参数****************************************/
        function hide(a, b = 5, c = 12) {
            console.log(a, b, c)
        }
        hide(12, 6, 9)
    </script>
</body>

</html>